<template>
  <div class="loading" v-if="loading">
    <span class="icon_loading iconEle"></span>
    <div class="loaders">
      <div class="loader">
        <div class="loader-inner line-spin-fade-loader">
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
          <div></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import { mapGetters } from 'vuex'
  export default {
    name: 'zz-goldLoading',
    computed: {
      ...mapGetters({
        loading: 'getLoading'
      })
    }
  }
</script>

<style lang="scss" scoped>
  .loading{
    text-align: center;
    z-index: 11;
    position: fixed;
    top: 45%;
    left: 49%;
    line-height: 100%;
    text-align: center;
    @keyframes line-spin-fade-loader {
      50% {
        opacity: 0.3; }

      100% {
        opacity: 1; } }

    .line-spin-fade-loader {
      position: relative;
      width: 60px;
      height: 60px;
      border-radius: 5px;
      background: #000;
      opacity: 0.6;
      top: -35px;
    }
    .line-spin-fade-loader > div:nth-child(1) {
      top: 40px;
      left: 25px;
      -webkit-animation: line-spin-fade-loader 1.2s 0.12s infinite ease-in-out;
      animation: line-spin-fade-loader 1.2s 0.12s infinite ease-in-out; }
    .line-spin-fade-loader > div:nth-child(2) {
      top: 33.63636px;
      left: 38.63636px;
      -webkit-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
      transform: rotate(-45deg);
      -webkit-animation: line-spin-fade-loader 1.2s 0.24s infinite ease-in-out;
      animation: line-spin-fade-loader 1.2s 0.24s infinite ease-in-out; }
    .line-spin-fade-loader > div:nth-child(3) {
      top: 20px;
      left: 45px;
      -webkit-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
      transform: rotate(90deg);
      -webkit-animation: line-spin-fade-loader 1.2s 0.36s infinite ease-in-out;
      animation: line-spin-fade-loader 1.2s 0.36s infinite ease-in-out; }
    .line-spin-fade-loader > div:nth-child(4) {
      top: 7.63636px;
      left: 38.63636px;
      -webkit-transform: rotate(45deg);
      -ms-transform: rotate(45deg);
      transform: rotate(45deg);
      -webkit-animation: line-spin-fade-loader 1.2s 0.48s infinite ease-in-out;
      animation: line-spin-fade-loader 1.2s 0.48s infinite ease-in-out; }
    .line-spin-fade-loader > div:nth-child(5) {
      top: 0px;
      left: 25px;
      -webkit-animation: line-spin-fade-loader 1.2s 0.6s infinite ease-in-out;
      animation: line-spin-fade-loader 1.2s 0.6s infinite ease-in-out; }
    .line-spin-fade-loader > div:nth-child(6) {
      top: 7.63636px;
      left: 12.63636px;
      -webkit-transform: rotate(-45deg);
      -ms-transform: rotate(-45deg);
      transform: rotate(-45deg);
      -webkit-animation: line-spin-fade-loader 1.2s 0.72s infinite ease-in-out;
      animation: line-spin-fade-loader 1.2s 0.72s infinite ease-in-out; }
    .line-spin-fade-loader > div:nth-child(7) {
      top: 20px;
      left: 5px;
      -webkit-transform: rotate(90deg);
      -ms-transform: rotate(90deg);
      transform: rotate(90deg);
      -webkit-animation: line-spin-fade-loader 1.2s 0.84s infinite ease-in-out;
      animation: line-spin-fade-loader 1.2s 0.84s infinite ease-in-out; }
    .line-spin-fade-loader > div:nth-child(8) {
      top: 33.63636px;
      left: 12.63636px;
      -webkit-transform: rotate(45deg);
      -ms-transform: rotate(45deg);
      transform: rotate(45deg);
      -webkit-animation: line-spin-fade-loader 1.2s 0.96s infinite ease-in-out;
      animation: line-spin-fade-loader 1.2s 0.96s infinite ease-in-out; }
    .line-spin-fade-loader > div {
      background-color: #fff;
      border-radius: 2px;
      margin: 2px;
      -webkit-animation-fill-mode: both;
      animation-fill-mode: both;
      position: absolute;
      width: 5px;
      height: 15px; }
  }
</style>
